package com.me.springsimple.entity;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="working")
public class WorkingEntity {
	
	private Integer workid;
	private String work;
	private List< EmpEntity > emp ;
	
	@Id
	@Column(name="workid")
	public Integer getWorkid() {
		return workid;
	}
	public void setWorkid(Integer workid) {
		this.workid = workid;
	}
	
	@Column(name="work")
	public String getWork() {
		return work;
	}
	public void setWork(String work) {
		this.work = work;
	}
	
	@OneToMany(fetch=FetchType.LAZY)
	@JoinColumn(name="workid")
	public List<EmpEntity> getEmp() {
		return emp;
	}
	public void setEmp(List<EmpEntity> emp) {
		this.emp = emp;
	}
	
	
	
}
